<?php
	/**
	 * Base interface for all objects in krome
	 *
	 * This is an interface that all objects in krome derive
	 * from. If functionality is required throughout all
	 * objects in krome, it should be incorporated here.
	 * 
	 * @author     Brandon R. Stoner <brandon.stoner@gmail.com>
	 * @copyright  Copyright 2008, Monokromatic Inc.
	 * @package    Core
	 * @subpackage Core	 	 
	 */
	abstract class IKromeBase
	{
			/**
			 * A "friendly" name for this object.
			 * @var string
			 */
		public $name = 'Krome Base Class';

			/**
			 * Get the name or classname of the object that the method was called on
			 * 
			 * Returns the name of the object that the method was called on if
			 * friendly is set to true. Otherwize, the classname of the object is
			 * returned.
			 *
			 * @param bool $friendly
			 * @return string
			 */
		public function GetName( $friendly = true )
		{
			if ($friendly !== true) { return get_class( $this ); }
			return $this->name;
		}

		/**
		 * Sets the friendly name for this object. Returns true if the name was
		 * changed.
		 * 		 		 
		 * @param string New friendly name for this object
		 * @return bool  True if this object's friendly name successfully changed		 		 		 
		 **/		 		
		public function SetName( $newName )
		{
			$retVal = false;

			if ( is_string($newName) && strlen($newName) > 0) {
   			$this->name = $newName;
   			$retVal     = true;
			}

			return $retVal;
		}
	}
?>
